}
GVariant *gpu_list[] = { first_nondefault_discrete, first_discrete, first_nondefault };
-
+
for (i = 0; i < G_N_ELEMENTS (gpu_list); ++i)
{
GVariant *gpu = gpu_list[i];
if (application_object_path == NULL || unique_bus_name == NULL)
return;
- g_clear_pointer (&app->running_state->unique_bus_name, g_free);
- app->running_state->unique_bus_name = g_strdup (unique_bus_name);
+ g_set_str (&app->running_state->unique_bus_name, unique_bus_name);
actions = g_dbus_action_group_get (app->running_state->session, unique_bus_name, application_object_path);
gtk_action_muxer_insert (app->running_state->muxer, "app", G_ACTION_GROUP (actions));
g_object_unref (actions);
return NULL;
}
-static gboolean
-set_class_list (gchar **class_list,
- const gchar *new_class_list)
-{
- if (g_strcmp0 (*class_list, new_class_list) != 0)
- {
- g_free (*class_list);
- *class_list = g_strdup (new_class_list);
- return TRUE;
- }
- else
- return FALSE;
-}
-
static gboolean
add_class_name (gchar **class_list,
const gchar *class_name)
priv = st_widget_get_instance_private (actor);
- if (set_class_list (&priv->style_class, style_class_list))
+ if (g_set_str (&priv->style_class, style_class_list))
{
st_widget_style_changed (actor);
g_object_notify_by_pspec (G_OBJECT (actor), props[PROP_STYLE_CLASS]);
priv = st_widget_get_instance_private (actor);
- if (set_class_list (&priv->pseudo_class, pseudo_class_list))
+ if (g_set_str (&priv->pseudo_class, pseudo_class_list))
{
st_widget_style_changed (actor);
g_object_notify_by_pspec (G_OBJECT (actor), props[PROP_PSEUDO_CLASS]);
priv = st_widget_get_instance_private (actor);
- if (g_strcmp0 (style, priv->inline_style))
+ if (g_set_str (&priv->inline_style, style))
{
- g_free (priv->inline_style);
- priv->inline_style = g_strdup (style);
-
st_widget_style_changed (actor);
g_object_notify_by_pspec (G_OBJECT (actor), props[PROP_STYLE]);